
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" >

<head th:replace="fragment/header :: head"></head>
<body>

	<style type="text/css">
		.container {
		    margin-top: 70px;
		    width: 400px;
		}
		
		.progress-bar {
		  -webkit-transition: width 1.1s ease-in-out;
		  transition: width 1.1s ease-in-out;
		}
	</style>

	<div class="container">
		<div class="row">
			<div class="progress">
			    <div class="progress-bar progress-bar-striped active customBar" role="progressbar" aria-valuenow="100" 
						aria-valuemin="0" aria-valuemax="100">
			        <span id="barText">Cargando..</span>
			    </div>
		    </div>		
		</div>
	</div>

	<form id="frm" name="frm" action="#" th:action="@{/authentication}" method="post">
		<input type="hidden" id="usuario" name="usuario"/>
	</form>

	<script type="text/javascript">
		function obtener_usuario(){
			try{
				 var wsh = new ActiveXObject("WScript.Shell");
				 var usuario = wsh.ExpandEnvironmentStrings("%USERNAME%");
				 $("#usuario").val(usuario);
			}catch(e){
				
			}
		}
		obtener_usuario();
		
			var bar = $('.customBar');
			$(function(){
			  $(bar).each(function(){
			    bar_width = $(this).attr('aria-valuenow');
			    $(this).width(bar_width + '%');
			  });
			});
		
			function sendSubmit(){
				document.frm.submit();
			}
			setTimeout('sendSubmit()', 1000);
	</script>

</body>

</html>